package ModelLayer;
import java.util.ArrayList;


/**
 * Write a description of class Udlaancontainer here.
 * 
 * @author (your name) 
 * @version (a version number or a date)
 */
public class Udlaancontainer
{
    private static Udlaancontainer instance = null;
    private ArrayList<Udlaan> u;
    

    /**
     * Constructor for objects of class Udlaancontainer
     */
    public Udlaancontainer()
    {
        u = new ArrayList<Udlaan>();
    }

    public static Udlaancontainer getInstance()
    {
        if(instance == null)
        {
            instance = new Udlaancontainer();
        }
        return instance;
    }
    
    public void addUdlaan(Udlaan udlaan)
    {
        u.add(udlaan);
    }
    
    public void sletUdlaan(Udlaan udlaan)
    {
        u.remove(udlaan);
    }
    
       public Udlaan findUdlaan(int id)
     {
    for (int i=0; i<this.u.size(); i++)
    {
        Udlaan udlaan = this.u.get(i);
        if (udlaan.getId() == id)
        {
             return udlaan;
        }   
     }
     return null; 
    }
    
}
